/* Base styles optimized for iframe and mobile-first design */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #8B0000, #2F4F4F);
    color: #fff;
    overflow: hidden;
}

/* Main game container - responsive height based on environment */
.game-container {
    width: 100%;
    height: 450px; /* Default iframe height */
    position: relative;
    display: flex;
    flex-direction: column;
    background: linear-gradient(135deg, #8B0000, #2F4F4F);
    border: 2px solid #DAA520;
}

/* Adjust height for full browser tab */
@media (min-height: 600px) {
    .game-container {
        height: 90vh;
    }
}

/* Screen management - only one screen visible at a time */
.screen {
    display: none;
    width: 100%;
    height: 100%;
    padding: 15px;
    overflow-y: auto;
}

.screen.active {
    display: flex;
    flex-direction: column;
}

/* Introduction screen styles */
.intro-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
}

.intro-text {
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 20px;
    max-width: 90%;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #DAA520;
}

.game-options h3 {
    margin-bottom: 15px;
    color: #DAA520;
}

/* Button styles optimized for touch and limited height */
.option-btn, .decision-btn, .continue-btn, .restart-btn {
    background: linear-gradient(145deg, #DAA520, #B8860B);
    border: 2px solid #FFD700;
    color: #000;
    padding: 12px 20px;
    margin: 8px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    min-height: 44px; /* Touch-friendly minimum */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
}

.option-btn:hover, .decision-btn:hover, .continue-btn:hover, .restart-btn:hover {
    background: linear-gradient(145deg, #FFD700, #DAA520);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.4);
}

.option-btn:active, .decision-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Objectives and clarification screens */
.objectives-content, .clarification-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
}

.objectives-text, .clarification-content p {
    font-size: 0.95rem;
    line-height: 1.4;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #DAA520;
}

.clarification-content ul {
    text-align: left;
    margin: 15px 0;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #DAA520;
}

.clarification-content li {
    margin: 8px 0;
}

/* Main game screen layout */
#gameScreen {
    position: relative;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding-right: 180px; /* Space for status meters */
}

/* Status meters positioned in bottom right */
.status-meters {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #DAA520;
    border-radius: 8px;
    padding: 12px;
    font-size: 0.8rem;
    min-width: 160px;
    z-index: 10;
}

.status-meters h4 {
    color: #DAA520;
    margin-bottom: 8px;
    font-size: 0.75rem;
}

.meter-item {
    margin: 4px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Round counter */
.round-counter {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid #DAA520;
    border-radius: 4px;
    padding: 8px 12px;
    text-align: center;
    font-weight: bold;
    color: #DAA520;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

/* Crisis text area */
.crisis-text {
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid #8B0000;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    font-size: 0.95rem;
    line-height: 1.4;
    flex: 1;
    min-height: 80px;
}

/* Decision options */
.decision-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.decision-btn {
    text-align: left;
    padding: 10px 15px;
    margin: 0;
    min-height: 60px;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

/* New styles for option header with symbols */
.option-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
    width: 100%;
}

.option-symbol {
    font-size: 1.2rem;
    min-width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.option-label {
    font-weight: bold;
    color: #000;
    flex: 1;
}

.option-description {
    font-size: 0.85rem;
    color: #333;
    line-height: 1.3;
}

/* Decision button color coding with symbol color adjustments */
.conservative {
    background: linear-gradient(145deg, #4682B4, #36648B);
    border-color: #87CEEB;
    color: #fff;
}

.conservative .option-label,
.conservative .option-description,
.conservative .option-symbol {
    color: #fff;
}

.moderate {
    background: linear-gradient(145deg, #DAA520, #B8860B);
    border-color: #FFD700;
}

.moderate .option-symbol {
    color: #000;
}

.radical {
    background: linear-gradient(145deg, #DC143C, #B22222);
    border-color: #FF6347;
    color: #fff;
}

.radical .option-label,
.radical .option-description,
.radical .option-symbol {
    color: #fff;
}

/* Results screen */
.results-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    gap: 15px;
}

.pravda-headline, .international-reaction, .citizen-responses {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #DAA520;
    border-radius: 8px;
    padding: 12px;
    flex: 1;
}

.pravda-headline h3, .international-reaction h3, .citizen-responses h3 {
    color: #DAA520;
    margin-bottom: 8px;
    font-size: 1rem;
}

.pravda-headline p, .international-reaction p {
    font-size: 0.9rem;
    line-height: 1.3;
}

#responsesList {
    font-size: 0.9rem;
    line-height: 1.3;
}

.response-item {
    margin: 8px 0;
    padding: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

/* End screen */
.end-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    text-align: center;
}

#endTitle {
    color: #DAA520;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

#endMessage {
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 20px;
    background: rgba(0, 0, 0, 0.3);
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #DAA520;
}

.final-stats {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid #DAA520;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

/* Tooltip for additional information */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    pointer-events: none;
    z-index: 1000;
    max-width: 200px;
    border: 1px solid #DAA520;
    display: none;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .main-content {
        padding-right: 0;
        padding-bottom: 140px; /* Space for status meters */
    }
    
    .status-meters {
        position: fixed;
        bottom: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        font-size: 0.75rem;
    }
    
    .decision-btn {
        min-height: 50px;
        font-size: 0.85rem;
    }
    
    .intro-text, .objectives-text {
        font-size: 0.9rem;
    }
    
    /* Adjust symbol size for mobile */
    .option-symbol {
        font-size: 1rem;
        min-width: 20px;
    }
}

/* High contrast mode for accessibility */
@media (prefers-contrast: high) {
    .game-container {
        border-width: 3px;
    }
    
    .option-btn, .decision-btn, .continue-btn, .restart-btn {
        border-width: 3px;
    }
}